package registnet.cpm.util;

import java.util.Comparator;
import registnet.cpm.Node;

/**
 * A comparator implementation that compares a node based on its early finish.
 */
public class NodeEarlyFinishComparatorImp implements Comparator<Node> {

	@Override
	public int compare(Node arg0, Node arg1) {
		int ef0 = arg0.getEarlyFinish();
		int ef1 = arg1.getEarlyFinish();
		if ((ef0) < (ef1))
			return -1;
		else if (ef0 > ef1)
			return 1;
		else
			return 0;
	}

}
